package com.sky.mapper;

import com.sky.entity.BookingOrder;
import com.sky.entity.MeetingRoom;
import com.sky.vo.OrderVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface BookingOrderMapper {


    /**
     *插入一个新订单
     * @param bookingOrder
     */

    void insert(BookingOrder bookingOrder);

    @Select("select * from booking_order where order_id=#{orderId}")
    BookingOrder getById(Long orderId);

    /**
     * 修改
     * @param bookingOrder
     */
    void update(BookingOrder bookingOrder);

    /**
     * 根据用户ID查询所有订单

     * @return 订单列表
     */

    List<OrderVO> getAllOrdersByUserId(Long userId);

    /**
     * 查询在指定时间段有已支付订单的会议室id
     * @param startTime
     * @param endTime
     * @param roomIds
     * @return
     */
    List<Long> getPaidBookedRoomIds(LocalDateTime startTime, LocalDateTime endTime, List<Long> roomIds);
}
